<?php

namespace App\Http\Resources;

class ArticleDetailResource extends ArticleResource
{
    /**
     * Transform the resource into an array.
     *
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        $baseInfo = parent::toArray($request);
        return array_merge($baseInfo, [
			'description' => (string)$this->description,
			'comments' => CommentResource::collection($this->comments),
        ]);
    }
}
